//
//  SearchAndShaiXuanView.m
//  EnterpriseEdition
//
//  Created by ypj on 2021/10/17.
//

#import "SearchAndShaiXuanView.h"

@implementation SearchAndShaiXuanView
-(instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
       
         self.grayView=[[UIView  alloc] init];
        [self addSubview:self.grayView];
         self.grayView.backgroundColor=[UIColor colorWithHexString:@"#F6F6F6"];
        
        
         self.searchButton=[UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.searchButton];
         self.searchButton.backgroundColor=mainColor;
        [self.searchButton setTitle:@"搜索" forState:UIControlStateNormal];
         self.searchButton.titleLabel.font=[UIFont systemFontOfSize:15.0];
        [self.searchButton setTitleColor:White_Color forState:UIControlStateNormal];
        [self.searchButton createBordersWithColor:nil withCornerRadius:5.0 andWidth:0];
        
       
        self.phoneTF=[[UITextField alloc] init];
        [self addSubview:self.phoneTF];
        self.phoneTF.font=[UIFont systemFontOfSize:14.0];
        self.phoneTF.placeholder=@"请输入手机号";
        
             
         self.searchIconImage=[[UIImageView alloc] init];
        [self.grayView addSubview:self.searchIconImage];
         self.searchIconImage.image=Image(@"searchIcon");
        
         self.lineView=[[UIView alloc] init];
        [self.grayView addSubview:self.lineView];
         self.lineView.backgroundColor=[UIColor colorWithHexString:@"#D8D7D7"];
       
//        self.zeRenRenLb=[[UILabel alloc] init];
//        [self addSubview:self.zeRenRenLb];
        self.zeRenRenLb.text=@"按负责人筛选";
        self.zeRenRenLb.textColor=gray979797_color;
        self.zeRenRenLb.font=[UIFont systemFontOfSize:14.0];
        
        
        self.saiXuanIconImage=[[UIImageView alloc] init];
       [self.grayView addSubview:self.saiXuanIconImage];
        self.saiXuanIconImage.image=Image(@"shaiXuan_icon");

       
        self.shaiXuanView=[[UIView alloc] init];
       [self addSubview:self.shaiXuanView];

        
        [self.grayView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake( ScreenWidth-16-91, 35));
            make.left.equalTo(self.mas_left).offset(16);
            make.top.equalTo(self.mas_top).offset(18);
        }];
        
        [_searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(60, 30));
            make.left.equalTo(self.grayView.mas_right).offset(20);
            make.top.equalTo(self.mas_top).offset(20);
        }];
       
        [_phoneTF mas_makeConstraints:^(MASConstraintMaker *make){
            make.size.mas_equalTo(CGSizeMake(ScreenWidth-157, 35));
            make.left.equalTo(self.grayView.mas_left).offset(50);
            make.top.equalTo(self.grayView.mas_top).offset(0);
        }];
        
        [self.searchIconImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(20, 20));
            make.left.equalTo(self.grayView.mas_left).offset(15);
            make.top.equalTo(self.grayView.mas_top).offset(7);
        }];
        
        [self.lineView mas_makeConstraints:^(MASConstraintMaker *make){
            make.size.mas_equalTo(CGSizeMake(1, 15));
            make.left.equalTo(self.searchIconImage.mas_right).offset(5);
            make.top.equalTo(self.grayView.mas_top).offset(10);
        }];
        
//        [self.zeRenRenLb mas_makeConstraints:^(MASConstraintMaker *make){
//            make.size.mas_equalTo(CGSizeMake(90, 20));
//            make.left.equalTo(self.mas_left).offset(16);
//            make.top.equalTo(self.grayView.mas_bottom).offset(7);
//        }];
        
//        [self.saiXuanIconImage mas_makeConstraints:^(MASConstraintMaker *make){
//            make.size.mas_equalTo(CGSizeMake(20, 20));
//            make.left.equalTo(self.zeRenRenLb.mas_right).offset(5);
//            make.top.equalTo(self.grayView.mas_bottom).offset(7);
//        }];
        
        [self.shaiXuanView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(ScreenWidth, 35));
            make.left.equalTo(self.mas_left).offset(0);
            make.right.equalTo(self.mas_right).offset(0);
            make.top.equalTo(self.grayView.mas_bottom).offset(0);
        }];
        
        
    }
    return self;
}


@end
